<template>
  <a-input-group compact>
    <a-select v-model="model[select.field]" :options="select.data" @change="changeHandle(select)"
      :defaultValue="select.default" style="width: 36%" :style="select.style" :allowClear="true" />
    <a-input v-model="model[input.field]" :style="input.style" style="width: 64%"
             :disabled="input.disabled" :allowClear="true" @blur="blurHandle(input)" />
  </a-input-group>
</template>

<script>
export default {
  name: "IvzSigForm",
  props: ['meta', 'model'],
  data() {
    return {
      select: {},
      input: {},
    }
  },
  created() {
    this.input = this.meta['input'];
    this.select = this.meta['select'];
  },
  methods: {
    changeHandle(meta) {
      let val = this.model[meta.field];
      if(meta.change) {
        meta.change(val, this.meta, this.model);
      }
    },
    blurHandle(meta) {
      if(meta.blur) {
        let val = this.model[meta.field];
        meta.blur(val, this.meta, this.model);
      }
    }
  }
}
</script>

<style scoped>

</style>
